function foo(a, b, ...rest) {
  console.log(`foo length: ${this.length}`);
}
const o = {
  bar(a, b, ...rest) {
    console.log(`bar length ${this.length}`);
  },
};
foo(1, 2); // foo length: undefined
console.log(foo.length); // 2
o.bar(1, 2); // bar length undefined
console.log(o.bar.length); // 2
const v1 = foo;
console.log(v1.length); // 2
const v2 = o.bar;
console.log(v2.length); // 2
